Last active
October 23, 2022 16:43
-
-
Save marketinview/2a7172dd9c599f83ca45 to your computer and use it in GitHub Desktop.
Qualtrics: Randomly reverse answer choices in multiple choice question. #qualtrics #js #jq #mc #random #reverse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
var rand = Math.round(Math.random()); | |
if(rand == 1) { | |
var choices = jQuery("#"+this.questionId+" li.Selection"); | |
var lastChoice = choices.last(); | |
for(i=0;i<choices.length-1;i++) { lastChoice.after(choices[i]); } | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See additional Qualtrics solutions at: https://qualtricswiki.tgibbons.com/doku.php